<%--
    Document   : xmlchat
    Created on : Apr 11, 2011, 12:55:02 PM
    Author     : Muhammad Anis
--%><%@page import="system.room"%>
<?xml version="1.0" encoding="ISO-8859-1"?><%@page import="tools.dbconnector"%>
    <%@page import="java.util.List"%>
    <jsp:useBean id="chatbeetwenfriend" class="system.chatbetweenfriend" scope="application" />
    <jsp:useBean id="allover" class="system.allover" scope="application" />
    <%@page import="user.user"%><%@ page contentType="text/xml;charset=ISO-8859-1" %>    
    <root>
    <%
        String task = request.getParameter("task");
        if(task!=null){
            if(task.equals("user")){
                dbconnector db = new dbconnector();
                List<String> userlist = db.getAllUser();
                for(String s : userlist){
                    out.print("<friend>"+s+"</friend>");
                }
            } else if(task.equals("room")){
                List<room> temp = allover.getAllRoom();
                for(room r: temp){
                    out.print("<room>"+r.nama+"</room>");
                }
             }
        }

    %>
    </root>

